package PTA.javabianchengjichu2;

import java.util.Scanner;

public class ex09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String line = sc.next();
        String str[] = new String[line.length()];
        StringBuilder sb = new StringBuilder();
        while(true){
            int i=0;
            if(line.equals("end")){
                break;
            }else{
                if(line.length()%3==0){
                   sb.append(line);
                   sb.append(" ");
                }

            }
            line=sc.next();
        }
        System.out.println(sb);

    }
}
